//
//  SHModel.m
//  UI_CarHome
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 沈浩. All rights reserved.
//

#import "SHModel.h"

@implementation SHModel

- (void)dealloc
{
    [_title release];
    [_indexdetail release];
    [_smallpic release];
    [_replycount release];
    [_lasttime release];
    [_mediatype release];
    [super dealloc];
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqual:@"id"]) {
        self.myId = value;
    }
}

// 归档和反归档
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.myId forKey:@"id"];
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.indexdetail forKey:@"indexdetail"];
    [aCoder encodeObject:self.smallpic forKey:@"smallpic"];
    [aCoder encodeObject:self.replycount forKey:@"replycount"];
    [aCoder encodeObject:self.lasttime forKey:@"lasttime"];
    [aCoder encodeObject:self.mediatype forKey:@"mediatype"];
    [aCoder encodeObject:self.topicid forKey:@"topicid"];
    [aCoder encodeObject:self.detailStr forKey:@"detailStr"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.myId = [aDecoder decodeObjectForKey:@"id"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.indexdetail = [aDecoder decodeObjectForKey:@"indextail"];
        self.smallpic = [aDecoder decodeObjectForKey:@"smallpic"];
        self.replycount = [aDecoder decodeObjectForKey:@"replycount"];
        self.lasttime = [aDecoder decodeObjectForKey:@"lasttime"];
        self.mediatype = [aDecoder decodeObjectForKey:@"mediatype"];
        self.topicid = [aDecoder decodeObjectForKey:@"topicid"];
        self.detailStr = [aDecoder decodeObjectForKey:@"detailStr"];
    }
    return self;
}



@end
